#include "beep_test.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

static int fd = -1;

int init_beep(void)
{
    fd = open("/dev/gec6818_beep_drv",O_WRONLY);
	if(fd == -1)
	{
        printf("open beep error\n");
		return fd;
	}
    beep_onOff(0);
	return 0;
}

void beep_onOff(int isOn)
{
    char user_buff;
    if(isOn)
    {
        user_buff = 1;
    }
    else
    {
        user_buff = 0;
    }
    write(fd,&user_buff,sizeof(user_buff));
}
